#pragma once

class CAttach
{
public:
	CAttach(void);
	~CAttach(void);
	HANDLE GetProcessHandleWithEnoughRights(DWORD PID, DWORD AccessRights);
	BOOL EnableTokenPrivilege(HANDLE htok, LPCTSTR szPrivilege, TOKEN_PRIVILEGES& tpOld);
	BOOL RestoreTokenPrivilege(HANDLE htok, const TOKEN_PRIVILEGES& tpOld);
	BOOL AdjustDacl(HANDLE h, DWORD DesiredAccess);
	BOOL AttachDll(DWORD dwLoginMsg, HWND hWndWow, HWND hWndExe, LPCTSTR lpDllName, DWORD dwShareId, LONG iInstances=-1);
    BOOL AttachDll(DWORD dwLoginMsg, LPCTSTR strPatch, HWND hWndExe, LPCTSTR lpDllName, DWORD dwShareId, LONG iInstances=-1);
    HANDLE GetProcess(HWND hWnd);
	BOOL IsWowMainWnd(HWND hWnd);
	BOOL HasAttackDll(DWORD dwProcessId, LPCTSTR lpDllName);
	BOOL EjectDll(LPCTSTR lpDllName);
	DWORD m_dwProcessId;
	CString mDllPath;
};
